﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Data;
using Newtonsoft.Json;

namespace Common.Utils
{
	public class JsonUtil
	{
        public static string ToJson(object obj)
        {
            return JsonConvert.SerializeObject(obj);
        }

        public static object ToObject(string jsonString)
        {
            return JsonConvert.DeserializeObject(jsonString);
        }

        public static T ToObject<T>(string jsonString)
        {
            return JsonConvert.DeserializeObject<T>(jsonString);
        }
	}
}
